package cn.ivicar.oss.quartz;

import cn.ivicar.oss.guice.OssGuiceConfig;
import cn.ivicar.sim.controller.SimWorkerController;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 更新sim卡信息及更新sim流量信息
 */
public class SimInfoJob implements Job {

    private static transient final Logger LOGGER = LoggerFactory.getLogger(SimInfoJob.class);

    private static SimWorkerController simWorkerController =
        OssGuiceConfig.getStaticInjector().getInstance(SimWorkerController.class);

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {

        LOGGER.info("定时任务：SimInfoJob开始执行");
        simWorkerController.updateSimInfo();//更新sim卡信息
        simWorkerController.updateSimFlowInfo();//更新sim流量信息
        LOGGER.info("定时任务：SimInfoJob执行完毕！");
    }
}
